/**
 * @file SdlBestFormatTest.hpp
 *
 * @date 12/02/2012
 * @author Tales 
 *
 */

#ifndef SDLBESTFORMATTEST_HPP_
#define SDLBESTFORMATTEST_HPP_

#include "Test.hpp"
#include <iostream>

namespace wolf {

class SdlBestFormatTest: public Test {
public:
	SdlBestFormatTest() :
			Test("SDL Best Format Test") {

	}
	virtual ~SdlBestFormatTest() {
	}

	bool run() {
		Engine engine(Engine::DEBUG);

		const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo();
		printVideoInfo(videoInfo);

		const int SCREEN_WIDTH = 800;
		const int SCREEN_HEIGHT = 600;

		engine.setVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 0);
		engine.setFrameRate(30);
		//Creating
		engine.start();
		return true;
	}

	void printVideoInfo(const SDL_VideoInfo *info) {
		cout << "hardware surfaces available   : " << _b(info->hw_available) << endl;
		cout << "window manager friendly       : " << _b(info->wm_available) << endl;
		cout << "Accelerated blits HW --> HW   : " << _b(info->blit_hw) << endl;
		cout << "Accelerated blits with Colokey: " << _b(info->blit_hw_CC) << endl;
		cout << "Accelerated blits with Alpha  : " << _b(info->blit_hw_A) << endl;
		cout << "Accelerated blits SW --> HW   : " << _b(info->blit_sw) << endl;
		cout << "Accelerated blits with Colokey: " << _b(info->blit_sw_CC) << endl;
		cout << "Accelerated blits with Alpha  : " << _b(info->blit_sw_A) << endl;
		cout << "Accelerated color fill        : " << _b(info->blit_fill) << endl;
		cout << "Total video memory            : " << info->video_mem << " KiB" << endl;
		cout << "Current width                 : " << info->current_w << " pixels" << endl;
		cout << "Current height                : " << info->current_h << " pixels" << endl;
	}

private:
	const char* _b(bool b) {
		return b ? "true" : "false";
	}
};

} /* namespace wolf */
#endif /* SDLBESTFORMATTEST_HPP_ */
